<!--
  ~ This program is part of the OpenLMIS logistics management information system platform software.
  ~ Copyright © 2013 VillageReach
  ~
  ~ This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  ~  
  ~ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
  ~ You should have received a copy of the GNU Affero General Public License along with this program.  If not, see http://www.gnu.org/licenses.  For additional information contact info@OpenLMIS.org. 
  -->
<div>
  <h2 id="addNewHeader" openlmis-message="create.report.addNew"></h2>

  <form id="reportForm" name="reportForm" action="/report-templates" method="POST" enctype="multipart/form-data"
        novalidate>
    <div class="app-form reports-form">
      <div class="row-fluid clearfix">
        <div class="span5">
          <label id="nameLabel" for="name">
            <span openlmis-message="create.report.reportName"></span>
            <span class="label-required"> *</span></label>

          <div>
            <input ng-model="template.name" name="name" id="name" type="text" maxlength="50"
                   ng-required="true"/>
            <span id="reportNameError" class="field-error" ng-show="reportForm.name.$error.required && showError"
                  openlmis-message="missing.value">
            </span>
          </div>
        </div>
      </div>

      <div class="row-fluid clearfix">
        <div class="span5">
          <label id="descriptionLabel" for="description" openlmis-message="create.report.description"></label>
          <input ng-model="template.description" name="description" id="description" type="text" maxlength="250"/>
        </div>
      </div>

      <div class="row-fluid clearfix">
        <div class="span5">
          <label id="uploadFileLabel" for="name">
            <span openlmis-message="create.report.uploadFile"></span>
            <span class="label-required"> *</span>
          </label>

          <div>
            <input ng-model="template.file" name="file" id="file" type="file" maxlength="50"
                   ng-required="true" accept=".jrxml"/>
            <span id="fileError" class="field-error" ng-show="reportForm.file.$error.required && showError"
                  openlmis-message="missing.value">
            </span>
          </div>
        </div>
      </div>
    </div>

    <div form-toolbar id="action_buttons" class="action-buttons">
      <div class="form-cell button-row">
        <input id="saveReport" class="btn btn-primary save-button" type="submit" openlmis-message="button.save"/>
        <a id="cancelButton" ng-href="#/list" class="btn btn-cancel submit-button" openlmis-message="button.cancel"></a>
      </div>
      <div id="error" class="toolbar-error" openlmis-message="errorMessage" ng-show="errorMessage"></div>
    </div>
  </form>
</div>

